<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>sqs.objects</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="sqs-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="sqs-module.html">Package&nbsp;sqs</a> ::
        Module&nbsp;objects
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="sqs.objects-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="sqs.objects-module.html">Module sqs.objects</a></h1>
<pre class="py-src">
<tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">xml</tt> </tt>
<tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">urlparse</tt> </tt>
<tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package sqs=sqs-module.html"><a title="sqs" class="py-name" href="#" onclick="return doclink('link-0', 'sqs', 'link-0');">sqs</a></tt></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Module sqs.errors=sqs.errors-module.html"><a title="sqs.errors" class="py-name" href="#" onclick="return doclink('link-1', 'errors', 'link-1');">errors</a></tt></tt> <tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Class sqs.errors.SQSError=sqs.errors.SQSError-class.html"><a title="sqs.errors.SQSError" class="py-name" href="#" onclick="return doclink('link-2', 'SQSError', 'link-2');">SQSError</a></tt></tt> </tt>
<tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-3" class="py-name"><a title="sqs" class="py-name" href="#" onclick="return doclink('link-3', 'sqs', 'link-0');">sqs</a></tt></tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Module sqs.parsers=sqs.parsers-module.html"><a title="sqs.parsers" class="py-name" href="#" onclick="return doclink('link-4', 'parsers', 'link-4');">parsers</a></tt></tt> <tt class="py-keyword">import</tt> <tt id="link-5" class="py-name" targets="Function sqs.parsers.parseTimeout()=sqs.parsers-module.html#parseTimeout"><a title="sqs.parsers.parseTimeout" class="py-name" href="#" onclick="return doclink('link-5', 'parseTimeout', 'link-5');">parseTimeout</a></tt></tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name" targets="Function sqs.parsers.parseMessageCreate()=sqs.parsers-module.html#parseMessageCreate"><a title="sqs.parsers.parseMessageCreate" class="py-name" href="#" onclick="return doclink('link-6', 'parseMessageCreate', 'link-6');">parseMessageCreate</a></tt></tt><tt class="py-op">,</tt> <tt id="link-7" class="py-name" targets="Function sqs.parsers.parseMessageRead()=sqs.parsers-module.html#parseMessageRead"><a title="sqs.parsers.parseMessageRead" class="py-name" href="#" onclick="return doclink('link-7', 'parseMessageRead', 'link-7');">parseMessageRead</a></tt></tt><tt class="py-op">,</tt> <tt id="link-8" class="py-name" targets="Function sqs.parsers.parseMessagesRead()=sqs.parsers-module.html#parseMessagesRead"><a title="sqs.parsers.parseMessagesRead" class="py-name" href="#" onclick="return doclink('link-8', 'parseMessagesRead', 'link-8');">parseMessagesRead</a></tt></tt> </tt>
<tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">StringIO</tt> <tt class="py-keyword">import</tt> <tt class="py-name">StringIO</tt> </tt>
<tt class="py-lineno">  6</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">  7</tt>  <tt class="py-line"> </tt>
<a name="SQSMessage"></a><div id="SQSMessage-def"><tt class="py-lineno">  8</tt> <a class="py-toggle" href="#" id="SQSMessage-toggle" onclick="return toggle('SQSMessage');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="sqs.objects.SQSMessage-class.html">SQSMessage</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSMessage-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="SQSMessage-expanded"><a name="SQSMessage.__init__"></a><div id="SQSMessage.__init__-def"><tt class="py-lineno">  9</tt> <a class="py-toggle" href="#" id="SQSMessage.__init__-toggle" onclick="return toggle('SQSMessage.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSMessage-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">body</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-param">id</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">queue</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSMessage.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSMessage.__init__-expanded"><tt class="py-lineno"> 10</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_body</tt> <tt class="py-op">=</tt> <tt id="link-9" class="py-name" targets="Variable sqs.objects.SQSMessage.body=sqs.objects.SQSMessage-class.html#body"><a title="sqs.objects.SQSMessage.body" class="py-name" href="#" onclick="return doclink('link-9', 'body', 'link-9');">body</a></tt></tt> </tt>
<tt class="py-lineno"> 11</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">id</tt> <tt class="py-op">=</tt> <tt class="py-name">id</tt> </tt>
<tt class="py-lineno"> 12</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">queue</tt> <tt class="py-op">=</tt> <tt class="py-name">queue</tt> </tt>
</div><tt class="py-lineno"> 13</tt>  <tt class="py-line"> </tt>
<a name="SQSMessage.__len__"></a><div id="SQSMessage.__len__-def"><tt class="py-lineno"> 14</tt> <a class="py-toggle" href="#" id="SQSMessage.__len__-toggle" onclick="return toggle('SQSMessage.__len__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSMessage-class.html#__len__">__len__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSMessage.__len__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSMessage.__len__-expanded"><tt class="py-lineno"> 15</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_body</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno"> 16</tt>  <tt class="py-line">     </tt>
<a name="SQSMessage.__str__"></a><div id="SQSMessage.__str__-def"><tt class="py-lineno"> 17</tt> <a class="py-toggle" href="#" id="SQSMessage.__str__-toggle" onclick="return toggle('SQSMessage.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSMessage-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSMessage.__str__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSMessage.__str__-expanded"><tt class="py-lineno"> 18</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_body</tt> </tt>
</div><tt class="py-lineno"> 19</tt>  <tt class="py-line"> </tt>
<a name="SQSMessage.__repr__"></a><div id="SQSMessage.__repr__-def"><tt class="py-lineno"> 20</tt> <a class="py-toggle" href="#" id="SQSMessage.__repr__-toggle" onclick="return toggle('SQSMessage.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSMessage-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSMessage.__repr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSMessage.__repr__-expanded"><tt class="py-lineno"> 21</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_body</tt> </tt>
</div><tt class="py-lineno"> 22</tt>  <tt class="py-line"> </tt>
<a name="SQSMessage._getBody"></a><div id="SQSMessage._getBody-def"><tt class="py-lineno"> 23</tt> <a class="py-toggle" href="#" id="SQSMessage._getBody-toggle" onclick="return toggle('SQSMessage._getBody');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSMessage-class.html#_getBody">_getBody</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSMessage._getBody-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSMessage._getBody-expanded"><tt class="py-lineno"> 24</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_body</tt> </tt>
</div><tt class="py-lineno"> 25</tt>  <tt class="py-line"> </tt>
<a name="SQSMessage._setBody"></a><div id="SQSMessage._setBody-def"><tt class="py-lineno"> 26</tt> <a class="py-toggle" href="#" id="SQSMessage._setBody-toggle" onclick="return toggle('SQSMessage._setBody');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSMessage-class.html#_setBody">_setBody</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">body</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSMessage._setBody-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSMessage._setBody-expanded"><tt class="py-lineno"> 27</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_body</tt> <tt class="py-op">=</tt> <tt id="link-10" class="py-name"><a title="sqs.objects.SQSMessage.body" class="py-name" href="#" onclick="return doclink('link-10', 'body', 'link-9');">body</a></tt></tt> </tt>
</div><tt class="py-lineno"> 28</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 29</tt>  <tt class="py-line">    <tt id="link-11" class="py-name"><a title="sqs.objects.SQSMessage.body" class="py-name" href="#" onclick="return doclink('link-11', 'body', 'link-9');">body</a></tt></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-12" class="py-name" targets="Method sqs.objects.SQSMessage._getBody()=sqs.objects.SQSMessage-class.html#_getBody"><a title="sqs.objects.SQSMessage._getBody" class="py-name" href="#" onclick="return doclink('link-12', '_getBody', 'link-12');">_getBody</a></tt></tt><tt class="py-op">,</tt> <tt id="link-13" class="py-name" targets="Method sqs.objects.SQSMessage._setBody()=sqs.objects.SQSMessage-class.html#_setBody"><a title="sqs.objects.SQSMessage._setBody" class="py-name" href="#" onclick="return doclink('link-13', '_setBody', 'link-13');">_setBody</a></tt></tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno"> 30</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 31</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 32</tt>  <tt class="py-line"> </tt>
<a name="SQSQueue"></a><div id="SQSQueue-def"><tt class="py-lineno"> 33</tt> <a class="py-toggle" href="#" id="SQSQueue-toggle" onclick="return toggle('SQSQueue');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="sqs.objects.SQSQueue-class.html">SQSQueue</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSQueue-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="SQSQueue-expanded"><a name="SQSQueue.__init__"></a><div id="SQSQueue.__init__-def"><tt class="py-lineno"> 34</tt> <a class="py-toggle" href="#" id="SQSQueue.__init__-toggle" onclick="return toggle('SQSQueue.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSQueue-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">url</tt><tt class="py-op">,</tt> <tt class="py-param">sqs_conn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSQueue.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSQueue.__init__-expanded"><tt class="py-lineno"> 35</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_sqs_conn</tt> <tt class="py-op">=</tt> <tt class="py-name">sqs_conn</tt> </tt>
<tt class="py-lineno"> 36</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">url</tt> <tt class="py-op">=</tt> <tt class="py-name">url</tt> </tt>
<tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">id</tt> <tt class="py-op">=</tt> <tt class="py-name">urlparse</tt><tt class="py-op">.</tt><tt class="py-name">urlparse</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">url</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt>  </tt>
<tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">id</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'/'</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
</div><tt class="py-lineno"> 39</tt>  <tt class="py-line"> </tt>
<a name="SQSQueue.__str__"></a><div id="SQSQueue.__str__-def"><tt class="py-lineno"> 40</tt> <a class="py-toggle" href="#" id="SQSQueue.__str__-toggle" onclick="return toggle('SQSQueue.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSQueue-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSQueue.__str__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSQueue.__str__-expanded"><tt class="py-lineno"> 41</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> </tt>
</div><tt class="py-lineno"> 42</tt>  <tt class="py-line"> </tt>
<a name="SQSQueue.__repr__"></a><div id="SQSQueue.__repr__-def"><tt class="py-lineno"> 43</tt> <a class="py-toggle" href="#" id="SQSQueue.__repr__-toggle" onclick="return toggle('SQSQueue.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSQueue-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSQueue.__repr__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSQueue.__repr__-expanded"><tt class="py-lineno"> 44</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> </tt>
</div><tt class="py-lineno"> 45</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-comment">##    def get_timeout(self):</tt> </tt>
<tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##        '''Get the visibility timeout for the queue</tt> </tt>
<tt class="py-lineno"> 48</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##        </tt> </tt>
<tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##        @return: Visibility timeout</tt> </tt>
<tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##        @rtype:  int</tt> </tt>
<tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##        '''</tt> </tt>
<tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##        response = self._sqs_conn.clone().get()</tt> </tt>
<tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##        print respo</tt> </tt>
<tt class="py-lineno"> 54</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##        return parseTimeout(response.read())</tt> </tt>
<tt class="py-lineno"> 55</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<tt class="py-lineno"> 56</tt>  <tt class="py-line"> </tt>
<a name="SQSQueue.read"></a><div id="SQSQueue.read-def"><tt class="py-lineno"> 57</tt> <a class="py-toggle" href="#" id="SQSQueue.read-toggle" onclick="return toggle('SQSQueue.read');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSQueue-class.html#read">read</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">timeout</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSQueue.read-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSQueue.read-expanded"><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<tt class="py-lineno"> 59</tt>  <tt class="py-line"><tt class="py-docstring">        Returns a single message or None if queue is empty</tt> </tt>
<tt class="py-lineno"> 60</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt class="py-docstring">        @param timeout: Message visibility timeout</tt> </tt>
<tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt class="py-docstring">        @type  timeout: int</tt> </tt>
<tt class="py-lineno"> 63</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        One SQSMessage from the front of the Queue</tt> </tt>
<tt class="py-lineno"> 64</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:         SQSMessage</tt> </tt>
<tt class="py-lineno"> 65</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<tt class="py-lineno"> 66</tt>  <tt class="py-line">        <tt class="py-name">params</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">timeout</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno"> 68</tt>  <tt class="py-line">            <tt class="py-name">params</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">'VisibilityTimeout'</tt> <tt class="py-op">:</tt> <tt class="py-name">timeout</tt><tt class="py-op">}</tt> </tt>
<tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-name">queue</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">id</tt> <tt class="py-op">+</tt> <tt class="py-string">'/front'</tt> </tt>
<tt class="py-lineno"> 70</tt>  <tt class="py-line">        <tt class="py-name">response</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_sqs_conn</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method sqs.connection.SQSConnection.clone()=sqs.connection.SQSConnection-class.html#clone"><a title="sqs.connection.SQSConnection.clone" class="py-name" href="#" onclick="return doclink('link-14', 'clone', 'link-14');">clone</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method sqs.service.SQSService.get()=sqs.service.SQSService-class.html#get"><a title="sqs.service.SQSService.get" class="py-name" href="#" onclick="return doclink('link-15', 'get', 'link-15');">get</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">queue</tt><tt class="py-op">=</tt><tt class="py-name">queue</tt><tt class="py-op">,</tt> <tt class="py-name">params</tt><tt class="py-op">=</tt><tt class="py-name">params</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-16" class="py-name"><a title="sqs.parsers.parseMessageRead" class="py-name" href="#" onclick="return doclink('link-16', 'parseMessageRead', 'link-7');">parseMessageRead</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">response</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name" targets="Method sqs.objects.SQSQueue.read()=sqs.objects.SQSQueue-class.html#read"><a title="sqs.objects.SQSQueue.read" class="py-name" href="#" onclick="return doclink('link-17', 'read', 'link-17');">read</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno"> 72</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 73</tt>  <tt class="py-line"> </tt>
<a name="SQSQueue.write"></a><div id="SQSQueue.write-def"><tt class="py-lineno"> 74</tt> <a class="py-toggle" href="#" id="SQSQueue.write-toggle" onclick="return toggle('SQSQueue.write');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSQueue-class.html#write">write</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">message</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSQueue.write-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSQueue.write-expanded"><tt class="py-lineno"> 75</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<tt class="py-lineno"> 76</tt>  <tt class="py-line"><tt class="py-docstring">        Add a single message to the queue</tt> </tt>
<tt class="py-lineno"> 77</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">        @param message: Message that should be added.</tt> </tt>
<tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring">        @type  message: SQSMessage</tt> </tt>
<tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        SQSMessage with assigned Queue</tt> </tt>
<tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:         SQSMessage</tt> </tt>
<tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<tt class="py-lineno"> 83</tt>  <tt class="py-line">        <tt class="py-name">message</tt><tt class="py-op">.</tt><tt class="py-name">queue</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt> </tt>
<tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-name">headers</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">'Content-Length'</tt><tt class="py-op">:</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">message</tt><tt class="py-op">)</tt><tt class="py-op">}</tt> </tt>
<tt class="py-lineno"> 85</tt>  <tt class="py-line">        <tt class="py-name">queue</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">id</tt> <tt class="py-op">+</tt> <tt class="py-string">'/back'</tt> </tt>
<tt class="py-lineno"> 86</tt>  <tt class="py-line">        <tt class="py-name">response</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_sqs_conn</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="sqs.connection.SQSConnection.clone" class="py-name" href="#" onclick="return doclink('link-18', 'clone', 'link-14');">clone</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">put</tt><tt class="py-op">(</tt><tt class="py-name">queue</tt><tt class="py-op">=</tt><tt class="py-name">queue</tt><tt class="py-op">,</tt> <tt class="py-name">send_io</tt><tt class="py-op">=</tt><tt class="py-name">StringIO</tt><tt class="py-op">(</tt><tt class="py-name">message</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="sqs.objects.SQSMessage.body" class="py-name" href="#" onclick="return doclink('link-19', 'body', 'link-9');">body</a></tt></tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt><tt class="py-op">=</tt><tt class="py-name">headers</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 87</tt>  <tt class="py-line">        <tt class="py-name">message</tt><tt class="py-op">.</tt><tt class="py-name">id</tt> <tt class="py-op">=</tt> <tt id="link-20" class="py-name"><a title="sqs.parsers.parseMessageCreate" class="py-name" href="#" onclick="return doclink('link-20', 'parseMessageCreate', 'link-6');">parseMessageCreate</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">response</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="sqs.objects.SQSQueue.read" class="py-name" href="#" onclick="return doclink('link-21', 'read', 'link-17');">read</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno"> 88</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">message</tt> </tt>
</div><tt class="py-lineno"> 89</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno"> 90</tt>  <tt class="py-line"> </tt>
<a name="SQSQueue.get_messages"></a><div id="SQSQueue.get_messages-def"><tt class="py-lineno"> 91</tt> <a class="py-toggle" href="#" id="SQSQueue.get_messages-toggle" onclick="return toggle('SQSQueue.get_messages');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSQueue-class.html#get_messages">get_messages</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">number</tt><tt class="py-op">,</tt> <tt class="py-param">timeout</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSQueue.get_messages-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSQueue.get_messages-expanded"><tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-docstring">'''Get a variable number of messages</tt> </tt>
<tt class="py-lineno"> 93</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring">        @param number:  Number of messages to get</tt> </tt>
<tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-docstring">        @type  number:  int</tt> </tt>
<tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-docstring">        @param timeout: Visibility timeout for the message</tt> </tt>
<tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt class="py-docstring">        @type  timeout: int</tt> </tt>
<tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt class="py-docstring">        @return:        List of messages</tt> </tt>
<tt class="py-lineno"> 99</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:         list</tt> </tt>
<tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-name">queue</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">id</tt> <tt class="py-op">+</tt> <tt class="py-string">'/front'</tt> </tt>
<tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-name">params</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-string">'NumberOfMessages'</tt> <tt class="py-op">:</tt> <tt class="py-name">number</tt><tt class="py-op">}</tt> </tt>
<tt class="py-lineno">103</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">timeout</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">104</tt>  <tt class="py-line">            <tt class="py-name">params</tt><tt class="py-op">[</tt><tt class="py-string">'VisibilityTimeout'</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">timeout</tt> </tt>
<tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-name">response</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_sqs_conn</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="sqs.connection.SQSConnection.clone" class="py-name" href="#" onclick="return doclink('link-22', 'clone', 'link-14');">clone</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="sqs.service.SQSService.get" class="py-name" href="#" onclick="return doclink('link-23', 'get', 'link-15');">get</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">queue</tt><tt class="py-op">=</tt><tt class="py-name">queue</tt><tt class="py-op">,</tt> <tt class="py-name">params</tt><tt class="py-op">=</tt><tt class="py-name">params</tt><tt class="py-op">)</tt> </tt>
<tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-24" class="py-name"><a title="sqs.parsers.parseMessagesRead" class="py-name" href="#" onclick="return doclink('link-24', 'parseMessagesRead', 'link-8');">parseMessagesRead</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">response</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name"><a title="sqs.objects.SQSQueue.read" class="py-name" href="#" onclick="return doclink('link-25', 'read', 'link-17');">read</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><tt class="py-lineno">107</tt>  <tt class="py-line"> </tt>
<tt class="py-lineno">108</tt>  <tt class="py-line"> </tt>
<a name="SQSQueue.delete"></a><div id="SQSQueue.delete-def"><tt class="py-lineno">109</tt> <a class="py-toggle" href="#" id="SQSQueue.delete-toggle" onclick="return toggle('SQSQueue.delete');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="sqs.objects.SQSQueue-class.html#delete">delete</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">message</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SQSQueue.delete-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SQSQueue.delete-expanded"><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-docstring">'''Delete the message from the queue</tt> </tt>
<tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-docstring">        @param message: Message to delete</tt> </tt>
<tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">        @type  message: SQSMessage</tt> </tt>
<tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<tt class="py-lineno">115</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">message</tt><tt class="py-op">,</tt> <tt class="py-string">'id'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<tt class="py-lineno">116</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_sqs_conn</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="sqs.connection.SQSConnection.clone" class="py-name" href="#" onclick="return doclink('link-26', 'clone', 'link-14');">clone</a></tt></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name" targets="Method sqs.objects.SQSQueue.delete()=sqs.objects.SQSQueue-class.html#delete,Method sqs.service.SQSService.delete()=sqs.service.SQSService-class.html#delete"><a title="sqs.objects.SQSQueue.delete
sqs.service.SQSService.delete" class="py-name" href="#" onclick="return doclink('link-27', 'delete', 'link-27');">delete</a></tt></tt><tt class="py-op">(</tt><tt class="py-name">queue</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">id</tt><tt class="py-op">,</tt> <tt class="py-name">message</tt><tt class="py-op">=</tt><tt class="py-name">message</tt><tt class="py-op">.</tt><tt class="py-name">id</tt><tt class="py-op">)</tt> </tt>
</div></div><tt class="py-lineno">117</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="sqs-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">Generated by Epydoc
        3.0alpha3 on Wed Sep 20 12:10:47 2006</td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
